/*
 * Project: BooEditor
 * Author:  Johannes Kuhaupt
 * Last Change:
 *    by:   $Author: $
 *    date: $Date:   $
 * Copyright (c): Johannes Kuhaupt
 * Licence: Creative Commons CC BY-NC-SA 3.0
 */
package view.fileFilter;

import control.FileManager;
import control.GuiManager;
import java.io.File;
import javax.swing.filechooser.FileFilter;

/**sdf
 *
 * @author Johannes Kuhaupt
 */
public class LejosFilter extends FileFilter {
    //Accept all directories and all gif, jpg, tiff, or png files.
    
    java.util.ResourceBundle langBundle = GuiManager.getLangBundle();
    
    /**
     *
     * @param f
     * @return
     */
    public boolean accept(File f) {
        if (f.isDirectory()) {
            return true;
        }
 
        String extension = FileManager.getExtension(f);
        if (extension != null) {
            if (extension.equals("java" )) {
                    return true;
            } else {
                return false;
            }
        }
 
        return false;
    }
 
    //The description of this filter
    /**
     *
     * @return
     */
    @Override
    public String getDescription() {
        return langBundle.getString("JavaFiles");
    }
    
    
}

 